package fr.resasante.ejb.service;

import java.util.Locale;

import javax.ejb.Remote;

import fr.resasante.ejb.dto.User;
import fr.resasante.ejb.utils.EjbResponse;

@Remote
public interface UserServiceRemote {
	/**
	 * Add a new user
	 * 
	 * @param userIncoming
	 *            The user object
	 * @param locale
	 *            The user Locale
	 * @return Errors if exists
	 */
	public EjbResponse addPatient(User userIncoming, Locale locale);

	/**
	 * Add a new professional
	 * 
	 * @param userIncoming
	 *            The user object
	 * @param locale
	 *            The user Locale
	 * @return Errors if exists
	 */
	public EjbResponse addProfessional(User userIncoming, Locale locale);

	/**
	 * Confirm a user registration by its salt
	 * 
	 * @param salt
	 *            The salt
	 * @return Errors if exists
	 */
	public EjbResponse confirmUser(String salt);

	/**
	 * Get a user object by salt
	 * 
	 * @param salt
	 *            The user salt
	 * @return The user object
	 */
	public User getUserBySalt(String salt);

	/**
	 * Get a user object by username
	 * 
	 * @param username
	 *            The user
	 * @return The user object
	 */
	public User getUserByUsername(String username);

	/**
	 * Retrieve an account
	 * 
	 * @param mail
	 *            The user email
	 * @param locale
	 *            The user Locale
	 * @return Errors if exists
	 */
	public EjbResponse retrieveAccount(String mail, Locale locale);

	/**
	 * Change password for an user
	 * 
	 * @param user
	 *            The user object providing informations
	 * @return True if failed
	 */
	public boolean changePassword(User user);
	
	/**
	 * Change password for an user
	 * 
	 * @param user
	 *            The user object providing informations
	 * @return True if failed
	 */
	public boolean changeAddress(User user);
}
